import 'package:flutter/material.dart';
import 'package:flutter_component_pay/src/theme.dart';
import 'package:flutter_component_pay/src/utils/abs_utils.dart';

///
/// 第三方支付标题小部件
///
class AbsThirdPayTitleView extends StatelessWidget {
  /// close事件
  final VoidCallback? onClose;

  const AbsThirdPayTitleView({
    super.key,
    this.onClose,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(
        left: 20,
        right: 18,
        top: 20,
      ),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Text(AbsPayTheme.title, style: AbsPayTheme.titleStyle),
          IconButton(
            onPressed: onClose,
            icon: AbsUtils.loadImage('close'),
          ),
        ],
      ),
    );
  }
}
